package cn.wynu.ioc.base;


import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App {
    public static void main(String[] args) {
        // ctrl + alt + v。先写赋值符号右边代码，左边自动生成
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("stus.xml");

        // .var 根据右边生成左边代码
        Object zs = context.getBean("zs");
        Object ls = context.getBean("lisi");

        System.out.println(zs);
        System.out.println(ls);


        Animal bean = context.getBean(Animal.class);
        Animal bean2 = context.getBean(Animal.class);
        System.out.println(bean);
        System.out.println(bean2);

        context.close();
    }
}
